package com.jiyun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jiyun.entity.Technician;
import com.jiyun.mapper.TechnicianMapper;
import com.jiyun.service.TechnicianService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * (Technician)表服务实现类
 *
 * @author LYT
 * @since 2025-01-16 18:33:06
 */
@Service("technicianService")
public class TechnicianServiceImpl extends ServiceImpl<TechnicianMapper, Technician> implements TechnicianService {
    @Autowired
    private TechnicianMapper technicianMapper;

    @Override
    public List<Technician> findAll(Technician technician) {
        LambdaQueryWrapper<Technician> qr = new LambdaQueryWrapper<>();
        if (technician.getTechnicianName() != null){
            qr.like(Technician::getTechnicianName, technician.getTechnicianName());
        }
        if(technician.getStatus()!=null){
            qr.eq(Technician::getStatus, technician.getStatus());
        }
        return technicianMapper.selectList(qr);
    }

    @Override
    public Technician selectStatus(Technician technician) {
        if (technician.getStatus() != null){
            return technicianMapper.selectStatus(technician);
        }
        return null;
    }


    @Override
    public List<Technician> selectPrice(Technician technician) {
        return technicianMapper.selectPrice(technician);

    }

    @Override
    public List<Technician> selectXiao() {
        return technicianMapper.selectXiao();
    }

    @Override
    public List<Technician> selectHao() {
        return technicianMapper.selectHao();
    }
}
